package cn.cena.pet.mapper;


import cn.cena.basic.mapper.BaseMapper;
import cn.cena.basic.util.PageList;
import cn.cena.pet.domain.Pet;
import cn.cena.pet.query.PetQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface PetMapper extends BaseMapper<Pet> {
    void onsale(Map<String, Object> params);

    void offSale(Map<String, Object> params);

    Pet loadByIdDetail(Long id);

    List<Pet> findByIds(@Param("ids") List<Long> ids, @Param("state") Integer state);

    /**
     * 查找上架的宠物
     * @param query
     * @param stateOnsale
     * @return
     */
    PageList<Pet> findByStateAndQuery(PetQuery query, Integer stateOnsale);

    Pet findOnsaleById(@Param("id") Long id, @Param("state") Integer state);
}
